<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>Paho C++: mqtt::buffer_ref&lt; T &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="pahologo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">Paho C++
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">The Paho MQTT C++ Client Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classmqtt_1_1buffer__ref.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classmqtt_1_1buffer__ref-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">mqtt::buffer_ref&lt; T &gt; Class Template Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>A reference object for holding immutable data buffers, with cheap copy semantics and lifetime management.  
 <a href="classmqtt_1_1buffer__ref.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="buffer__ref_8h_source.html">buffer_ref.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a1f962b2f5de758efac7e9f45b445d5a0"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#a1f962b2f5de758efac7e9f45b445d5a0">value_type</a> = T</td></tr>
<tr class="memdesc:a1f962b2f5de758efac7e9f45b445d5a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">The underlying type for the buffer.  <a href="#a1f962b2f5de758efac7e9f45b445d5a0">More...</a><br/></td></tr>
<tr class="separator:a1f962b2f5de758efac7e9f45b445d5a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a792a9ecfb61b558d575240a88b8195a0"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#a792a9ecfb61b558d575240a88b8195a0">blob</a> = std::basic_string&lt; <a class="el" href="classmqtt_1_1buffer__ref.html#a1f962b2f5de758efac7e9f45b445d5a0">value_type</a> &gt;</td></tr>
<tr class="memdesc:a792a9ecfb61b558d575240a88b8195a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">The type for the buffer.  <a href="#a792a9ecfb61b558d575240a88b8195a0">More...</a><br/></td></tr>
<tr class="separator:a792a9ecfb61b558d575240a88b8195a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9bc5bece985507f5ac0979c9984b5105"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#a9bc5bece985507f5ac0979c9984b5105">pointer_type</a> = std::shared_ptr&lt; const <a class="el" href="classmqtt_1_1buffer__ref.html#a792a9ecfb61b558d575240a88b8195a0">blob</a> &gt;</td></tr>
<tr class="memdesc:a9bc5bece985507f5ac0979c9984b5105"><td class="mdescLeft">&#160;</td><td class="mdescRight">The pointer we use.  <a href="#a9bc5bece985507f5ac0979c9984b5105">More...</a><br/></td></tr>
<tr class="separator:a9bc5bece985507f5ac0979c9984b5105"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a35212893609858049401f945acc2fc2e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a35212893609858049401f945acc2fc2e"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#a35212893609858049401f945acc2fc2e">buffer_ref</a> ()=default</td></tr>
<tr class="memdesc:a35212893609858049401f945acc2fc2e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor creates a null reference. <br/></td></tr>
<tr class="separator:a35212893609858049401f945acc2fc2e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a398ea9054ccfa56721bc9d8745a067eb"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#a398ea9054ccfa56721bc9d8745a067eb">buffer_ref</a> (const <a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a> &amp;buf)=default</td></tr>
<tr class="memdesc:a398ea9054ccfa56721bc9d8745a067eb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy constructor only copies a shared pointer.  <a href="#a398ea9054ccfa56721bc9d8745a067eb">More...</a><br/></td></tr>
<tr class="separator:a398ea9054ccfa56721bc9d8745a067eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad7f703da8d1fbaee1b784127dd806a65"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#ad7f703da8d1fbaee1b784127dd806a65">buffer_ref</a> (<a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a> &amp;&amp;buf)=default</td></tr>
<tr class="memdesc:ad7f703da8d1fbaee1b784127dd806a65"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move constructor only moves a shared pointer.  <a href="#ad7f703da8d1fbaee1b784127dd806a65">More...</a><br/></td></tr>
<tr class="separator:ad7f703da8d1fbaee1b784127dd806a65"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab0bb54e77affc6d6c5c8f27210e5bdec"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#ab0bb54e77affc6d6c5c8f27210e5bdec">buffer_ref</a> (const <a class="el" href="classmqtt_1_1buffer__ref.html#a792a9ecfb61b558d575240a88b8195a0">blob</a> &amp;b)</td></tr>
<tr class="memdesc:ab0bb54e77affc6d6c5c8f27210e5bdec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a reference to a new buffer by copying data.  <a href="#ab0bb54e77affc6d6c5c8f27210e5bdec">More...</a><br/></td></tr>
<tr class="separator:ab0bb54e77affc6d6c5c8f27210e5bdec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aff85012382a93bc6294be98c9a0a903d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#aff85012382a93bc6294be98c9a0a903d">buffer_ref</a> (<a class="el" href="classmqtt_1_1buffer__ref.html#a792a9ecfb61b558d575240a88b8195a0">blob</a> &amp;&amp;b)</td></tr>
<tr class="memdesc:aff85012382a93bc6294be98c9a0a903d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a reference to a new buffer by moving a string into the buffer.  <a href="#aff85012382a93bc6294be98c9a0a903d">More...</a><br/></td></tr>
<tr class="separator:aff85012382a93bc6294be98c9a0a903d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adf4aff851797ef244a7483c16a27ca76"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#adf4aff851797ef244a7483c16a27ca76">buffer_ref</a> (const <a class="el" href="classmqtt_1_1buffer__ref.html#a9bc5bece985507f5ac0979c9984b5105">pointer_type</a> &amp;p)</td></tr>
<tr class="memdesc:adf4aff851797ef244a7483c16a27ca76"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a reference to an existing buffer by copying the shared pointer.  <a href="#adf4aff851797ef244a7483c16a27ca76">More...</a><br/></td></tr>
<tr class="separator:adf4aff851797ef244a7483c16a27ca76"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a176e51bbc0062a284433af23c41b34c0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#a176e51bbc0062a284433af23c41b34c0">buffer_ref</a> (<a class="el" href="classmqtt_1_1buffer__ref.html#a9bc5bece985507f5ac0979c9984b5105">pointer_type</a> &amp;&amp;p)</td></tr>
<tr class="memdesc:a176e51bbc0062a284433af23c41b34c0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a reference to an existing buffer by moving the shared pointer.  <a href="#a176e51bbc0062a284433af23c41b34c0">More...</a><br/></td></tr>
<tr class="separator:a176e51bbc0062a284433af23c41b34c0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac4aa4005b807f820eed02cf50dea273b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#ac4aa4005b807f820eed02cf50dea273b">buffer_ref</a> (const <a class="el" href="classmqtt_1_1buffer__ref.html#a1f962b2f5de758efac7e9f45b445d5a0">value_type</a> *buf, size_t n)</td></tr>
<tr class="memdesc:ac4aa4005b807f820eed02cf50dea273b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a reference to a new buffer containing a copy of the data.  <a href="#ac4aa4005b807f820eed02cf50dea273b">More...</a><br/></td></tr>
<tr class="separator:ac4aa4005b807f820eed02cf50dea273b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0595b66a3fb58e5a024345289ea7e855"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#a0595b66a3fb58e5a024345289ea7e855">buffer_ref</a> (const char *buf)</td></tr>
<tr class="memdesc:a0595b66a3fb58e5a024345289ea7e855"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a reference to a new buffer containing a copy of the NUL-terminated char array.  <a href="#a0595b66a3fb58e5a024345289ea7e855">More...</a><br/></td></tr>
<tr class="separator:a0595b66a3fb58e5a024345289ea7e855"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8bae1b1db07ca36264ba6d48a99cdbe7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#a8bae1b1db07ca36264ba6d48a99cdbe7">operator=</a> (const <a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a> &amp;rhs)=default</td></tr>
<tr class="memdesc:a8bae1b1db07ca36264ba6d48a99cdbe7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy the reference to the buffer.  <a href="#a8bae1b1db07ca36264ba6d48a99cdbe7">More...</a><br/></td></tr>
<tr class="separator:a8bae1b1db07ca36264ba6d48a99cdbe7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a71caf76e9ab4521b4a50092a207b0de1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#a71caf76e9ab4521b4a50092a207b0de1">operator=</a> (<a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a> &amp;&amp;rhs)=default</td></tr>
<tr class="memdesc:a71caf76e9ab4521b4a50092a207b0de1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move a reference to a buffer.  <a href="#a71caf76e9ab4521b4a50092a207b0de1">More...</a><br/></td></tr>
<tr class="separator:a71caf76e9ab4521b4a50092a207b0de1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a47b2bd295fed12a14325a07b872a6dbd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#a47b2bd295fed12a14325a07b872a6dbd">operator=</a> (const <a class="el" href="classmqtt_1_1buffer__ref.html#a792a9ecfb61b558d575240a88b8195a0">blob</a> &amp;b)</td></tr>
<tr class="memdesc:a47b2bd295fed12a14325a07b872a6dbd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy a string into this object, creating a new buffer.  <a href="#a47b2bd295fed12a14325a07b872a6dbd">More...</a><br/></td></tr>
<tr class="separator:a47b2bd295fed12a14325a07b872a6dbd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a929d718638a0646e6f484d07f1610faa"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#a929d718638a0646e6f484d07f1610faa">operator=</a> (<a class="el" href="classmqtt_1_1buffer__ref.html#a792a9ecfb61b558d575240a88b8195a0">blob</a> &amp;&amp;b)</td></tr>
<tr class="memdesc:a929d718638a0646e6f484d07f1610faa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move a string into this object, creating a new buffer.  <a href="#a929d718638a0646e6f484d07f1610faa">More...</a><br/></td></tr>
<tr class="separator:a929d718638a0646e6f484d07f1610faa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab9e1fcda1683788fba1eed65006ff375"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#ab9e1fcda1683788fba1eed65006ff375">operator=</a> (const char *cstr)</td></tr>
<tr class="memdesc:ab9e1fcda1683788fba1eed65006ff375"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy a NUL-terminated C char array into a new buffer.  <a href="#ab9e1fcda1683788fba1eed65006ff375">More...</a><br/></td></tr>
<tr class="separator:ab9e1fcda1683788fba1eed65006ff375"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad9538182730ddbeb04ac35b8cbb95307"><td class="memTemplParams" colspan="2">template&lt;typename OT &gt; </td></tr>
<tr class="memitem:ad9538182730ddbeb04ac35b8cbb95307"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a> &amp;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#ad9538182730ddbeb04ac35b8cbb95307">operator=</a> (const <a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a>&lt; OT &gt; &amp;rhs)</td></tr>
<tr class="memdesc:ad9538182730ddbeb04ac35b8cbb95307"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy another type of buffer reference to this one.  <a href="#ad9538182730ddbeb04ac35b8cbb95307">More...</a><br/></td></tr>
<tr class="separator:ad9538182730ddbeb04ac35b8cbb95307"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adb825ca3db27ec312a4aeba1724f2c07"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adb825ca3db27ec312a4aeba1724f2c07"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#adb825ca3db27ec312a4aeba1724f2c07">reset</a> ()</td></tr>
<tr class="memdesc:adb825ca3db27ec312a4aeba1724f2c07"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears the reference to nil. <br/></td></tr>
<tr class="separator:adb825ca3db27ec312a4aeba1724f2c07"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acacac9264e401714ac4e0ffc58755bb6"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#acacac9264e401714ac4e0ffc58755bb6">operator bool</a> () const </td></tr>
<tr class="memdesc:acacac9264e401714ac4e0ffc58755bb6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Determines if the reference is valid.  <a href="#acacac9264e401714ac4e0ffc58755bb6">More...</a><br/></td></tr>
<tr class="separator:acacac9264e401714ac4e0ffc58755bb6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6ce9a7a7cd68a6b3bd6f5b1bfc08e9cc"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#a6ce9a7a7cd68a6b3bd6f5b1bfc08e9cc">is_null</a> () const </td></tr>
<tr class="memdesc:a6ce9a7a7cd68a6b3bd6f5b1bfc08e9cc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Determines if the reference is invalid.  <a href="#a6ce9a7a7cd68a6b3bd6f5b1bfc08e9cc">More...</a><br/></td></tr>
<tr class="separator:a6ce9a7a7cd68a6b3bd6f5b1bfc08e9cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7fc93b3215ffcb9f8798b6350ac0604f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#a7fc93b3215ffcb9f8798b6350ac0604f">empty</a> () const </td></tr>
<tr class="memdesc:a7fc93b3215ffcb9f8798b6350ac0604f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Determines if the buffer is empty.  <a href="#a7fc93b3215ffcb9f8798b6350ac0604f">More...</a><br/></td></tr>
<tr class="separator:a7fc93b3215ffcb9f8798b6350ac0604f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac1b6fab48232abddbf8d1857e2bf751f"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classmqtt_1_1buffer__ref.html#a1f962b2f5de758efac7e9f45b445d5a0">value_type</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#ac1b6fab48232abddbf8d1857e2bf751f">data</a> () const </td></tr>
<tr class="memdesc:ac1b6fab48232abddbf8d1857e2bf751f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets a const pointer to the data buffer.  <a href="#ac1b6fab48232abddbf8d1857e2bf751f">More...</a><br/></td></tr>
<tr class="separator:ac1b6fab48232abddbf8d1857e2bf751f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9f0d34a9a04996bbf40274af07ac20d7"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#a9f0d34a9a04996bbf40274af07ac20d7">size</a> () const </td></tr>
<tr class="memdesc:a9f0d34a9a04996bbf40274af07ac20d7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the size of the data buffer.  <a href="#a9f0d34a9a04996bbf40274af07ac20d7">More...</a><br/></td></tr>
<tr class="separator:a9f0d34a9a04996bbf40274af07ac20d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5eb836c895c0a9978f544b9c497db96a"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#a5eb836c895c0a9978f544b9c497db96a">length</a> () const </td></tr>
<tr class="memdesc:a5eb836c895c0a9978f544b9c497db96a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the size of the data buffer.  <a href="#a5eb836c895c0a9978f544b9c497db96a">More...</a><br/></td></tr>
<tr class="separator:a5eb836c895c0a9978f544b9c497db96a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad43932e2a6a5debe8036d6d5af2d76da"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classmqtt_1_1buffer__ref.html#a792a9ecfb61b558d575240a88b8195a0">blob</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#ad43932e2a6a5debe8036d6d5af2d76da">str</a> () const </td></tr>
<tr class="memdesc:ad43932e2a6a5debe8036d6d5af2d76da"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the data buffer as a string.  <a href="#ad43932e2a6a5debe8036d6d5af2d76da">More...</a><br/></td></tr>
<tr class="separator:ad43932e2a6a5debe8036d6d5af2d76da"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a940a8cf306fd985b2f3c85a79328b423"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classmqtt_1_1buffer__ref.html#a792a9ecfb61b558d575240a88b8195a0">blob</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#a940a8cf306fd985b2f3c85a79328b423">to_string</a> () const </td></tr>
<tr class="memdesc:a940a8cf306fd985b2f3c85a79328b423"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the data buffer as a string.  <a href="#a940a8cf306fd985b2f3c85a79328b423">More...</a><br/></td></tr>
<tr class="separator:a940a8cf306fd985b2f3c85a79328b423"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a686a9aecf29f8290e1ba8161ac81d12b"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#a686a9aecf29f8290e1ba8161ac81d12b">c_str</a> () const </td></tr>
<tr class="memdesc:a686a9aecf29f8290e1ba8161ac81d12b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the data buffer as NUL-terminated C string.  <a href="#a686a9aecf29f8290e1ba8161ac81d12b">More...</a><br/></td></tr>
<tr class="separator:a686a9aecf29f8290e1ba8161ac81d12b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ade1b93fa4991a93f9151dcc758404721"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classmqtt_1_1buffer__ref.html#a9bc5bece985507f5ac0979c9984b5105">pointer_type</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#ade1b93fa4991a93f9151dcc758404721">ptr</a> () const </td></tr>
<tr class="memdesc:ade1b93fa4991a93f9151dcc758404721"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets a shared pointer to the (const) data buffer.  <a href="#ade1b93fa4991a93f9151dcc758404721">More...</a><br/></td></tr>
<tr class="separator:ade1b93fa4991a93f9151dcc758404721"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaab117442ba1e5cf8d870bda1d0096f0"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classmqtt_1_1buffer__ref.html#a1f962b2f5de758efac7e9f45b445d5a0">value_type</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1buffer__ref.html#aaab117442ba1e5cf8d870bda1d0096f0">operator[]</a> (size_t i) const </td></tr>
<tr class="memdesc:aaab117442ba1e5cf8d870bda1d0096f0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets elemental access to the data buffer (read only)  <a href="#aaab117442ba1e5cf8d870bda1d0096f0">More...</a><br/></td></tr>
<tr class="separator:aaab117442ba1e5cf8d870bda1d0096f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename T&gt;<br/>
class mqtt::buffer_ref&lt; T &gt;</h3>

<p>A reference object for holding immutable data buffers, with cheap copy semantics and lifetime management. </p>
<p>Each object of this class contains a reference-counted pointer to an immutable data buffer. Objects can be copied freely and easily, even across threads, since all instances promise not to modify the contents of the buffer.</p>
<p>The buffer is immutable but the reference itself acts like a normal variable. It can be reassigned to point to a different buffer.</p>
<p>If no value has been assigned to a reference, then it is in a default "null" state. It is not safe to call any member functions on a null reference, other than to check if the object is null or empty. </p>
<pre class="fragment">* string_ref sr;
* if (!sr)
*   cout &lt;&lt; "null reference" &lt;&lt; endl;
* else
*   cout.write(sr.data(), sr.size());
* </pre> </div><h2 class="groupheader">Member Typedef Documentation</h2>
<a class="anchor" id="a792a9ecfb61b558d575240a88b8195a0"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">using <a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::<a class="el" href="classmqtt_1_1buffer__ref.html#a792a9ecfb61b558d575240a88b8195a0">blob</a> =  std::basic_string&lt;<a class="el" href="classmqtt_1_1buffer__ref.html#a1f962b2f5de758efac7e9f45b445d5a0">value_type</a>&gt;</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The type for the buffer. </p>
<p>We use basic_string for compatibility with string data. </p>

</div>
</div>
<a class="anchor" id="a9bc5bece985507f5ac0979c9984b5105"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">using <a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::<a class="el" href="classmqtt_1_1buffer__ref.html#a9bc5bece985507f5ac0979c9984b5105">pointer_type</a> =  std::shared_ptr&lt;const <a class="el" href="classmqtt_1_1buffer__ref.html#a792a9ecfb61b558d575240a88b8195a0">blob</a>&gt;</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The pointer we use. </p>
<p>Note that it is a pointer to a <em>const</em> blob. </p>

</div>
</div>
<a class="anchor" id="a1f962b2f5de758efac7e9f45b445d5a0"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">using <a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::<a class="el" href="classmqtt_1_1buffer__ref.html#a1f962b2f5de758efac7e9f45b445d5a0">value_type</a> =  T</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The underlying type for the buffer. </p>
<p>Normally byte-wide data (char or uint8_t) for Paho. </p>

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a398ea9054ccfa56721bc9d8745a067eb"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::<a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>buf</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">default</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Copy constructor only copies a shared pointer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buf</td><td>Another buffer reference. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ad7f703da8d1fbaee1b784127dd806a65"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::<a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a>&lt; T &gt; &amp;&amp;&#160;</td>
          <td class="paramname"><em>buf</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">default</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Move constructor only moves a shared pointer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buf</td><td>Another buffer reference. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ab0bb54e77affc6d6c5c8f27210e5bdec"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::<a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classmqtt_1_1buffer__ref.html#a792a9ecfb61b558d575240a88b8195a0">blob</a> &amp;&#160;</td>
          <td class="paramname"><em>b</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Creates a reference to a new buffer by copying data. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">b</td><td>A string from which to create a new buffer. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aff85012382a93bc6294be98c9a0a903d"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::<a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classmqtt_1_1buffer__ref.html#a792a9ecfb61b558d575240a88b8195a0">blob</a> &amp;&amp;&#160;</td>
          <td class="paramname"><em>b</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Creates a reference to a new buffer by moving a string into the buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">b</td><td>A string from which to create a new buffer. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="adf4aff851797ef244a7483c16a27ca76"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::<a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classmqtt_1_1buffer__ref.html#a9bc5bece985507f5ac0979c9984b5105">pointer_type</a> &amp;&#160;</td>
          <td class="paramname"><em>p</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Creates a reference to an existing buffer by copying the shared pointer. </p>
<p>Note that it is up to the caller to insure that there are no mutable references to the buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>A shared pointer to a string. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a176e51bbc0062a284433af23c41b34c0"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::<a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classmqtt_1_1buffer__ref.html#a9bc5bece985507f5ac0979c9984b5105">pointer_type</a> &amp;&amp;&#160;</td>
          <td class="paramname"><em>p</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Creates a reference to an existing buffer by moving the shared pointer. </p>
<p>Note that it is up to the caller to insure that there are no mutable references to the buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>A shared pointer to a string. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ac4aa4005b807f820eed02cf50dea273b"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::<a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classmqtt_1_1buffer__ref.html#a1f962b2f5de758efac7e9f45b445d5a0">value_type</a> *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>n</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Creates a reference to a new buffer containing a copy of the data. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buf</td><td>The memory to copy </td></tr>
    <tr><td class="paramname">n</td><td>The number of bytes to copy. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a0595b66a3fb58e5a024345289ea7e855"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::<a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a> </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>buf</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Creates a reference to a new buffer containing a copy of the NUL-terminated char array. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buf</td><td>A NUL-terminated char array (C string). </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a686a9aecf29f8290e1ba8161ac81d12b"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const char* <a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::c_str </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Gets the data buffer as NUL-terminated C string. </p>
<p>Note that the reference must be set to call this function. </p>
<dl class="section return"><dt>Returns</dt><dd>The data buffer as a string. </dd></dl>

</div>
</div>
<a class="anchor" id="ac1b6fab48232abddbf8d1857e2bf751f"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classmqtt_1_1buffer__ref.html#a1f962b2f5de758efac7e9f45b445d5a0">value_type</a>* <a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::data </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Gets a const pointer to the data buffer. </p>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the data buffer. </dd></dl>

</div>
</div>
<a class="anchor" id="a7fc93b3215ffcb9f8798b6350ac0604f"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::empty </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Determines if the buffer is empty. </p>
<dl class="section return"><dt>Returns</dt><dd><em>true</em> if the buffer is empty or thr reference is null, <em>false</em> if the buffer contains data. </dd></dl>

</div>
</div>
<a class="anchor" id="a6ce9a7a7cd68a6b3bd6f5b1bfc08e9cc"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::is_null </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Determines if the reference is invalid. </p>
<p>If the reference is invalid then it is not safe to call <em>any</em> member functions other than <a class="el" href="classmqtt_1_1buffer__ref.html#a6ce9a7a7cd68a6b3bd6f5b1bfc08e9cc">is_null()</a> and <a class="el" href="classmqtt_1_1buffer__ref.html#a7fc93b3215ffcb9f8798b6350ac0604f">empty()</a> </p>
<dl class="section return"><dt>Returns</dt><dd><em>true</em> if the reference is null, <em>false</em> if it is referring to a valid buffer, </dd></dl>

</div>
</div>
<a class="anchor" id="a5eb836c895c0a9978f544b9c497db96a"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">size_t <a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::length </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Gets the size of the data buffer. </p>
<dl class="section return"><dt>Returns</dt><dd>The size of the data buffer. </dd></dl>

</div>
</div>
<a class="anchor" id="acacac9264e401714ac4e0ffc58755bb6"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::operator bool </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Determines if the reference is valid. </p>
<p>If the reference is invalid then it is not safe to call <em>any</em> member functions other than <a class="el" href="classmqtt_1_1buffer__ref.html#a6ce9a7a7cd68a6b3bd6f5b1bfc08e9cc">is_null()</a> and <a class="el" href="classmqtt_1_1buffer__ref.html#a7fc93b3215ffcb9f8798b6350ac0604f">empty()</a> </p>
<dl class="section return"><dt>Returns</dt><dd><em>true</em> if referring to a valid buffer, <em>false</em> if the reference (pointer) is null. </dd></dl>

</div>
</div>
<a class="anchor" id="a8bae1b1db07ca36264ba6d48a99cdbe7"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a>&amp; <a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::operator= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>rhs</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">default</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Copy the reference to the buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">rhs</td><td>Another buffer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A reference to this object </dd></dl>

</div>
</div>
<a class="anchor" id="a71caf76e9ab4521b4a50092a207b0de1"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a>&amp; <a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::operator= </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a>&lt; T &gt; &amp;&amp;&#160;</td>
          <td class="paramname"><em>rhs</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">default</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Move a reference to a buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">rhs</td><td>The other reference to move. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A reference to this object. </dd></dl>

</div>
</div>
<a class="anchor" id="a47b2bd295fed12a14325a07b872a6dbd"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a>&amp; <a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::operator= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classmqtt_1_1buffer__ref.html#a792a9ecfb61b558d575240a88b8195a0">blob</a> &amp;&#160;</td>
          <td class="paramname"><em>b</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Copy a string into this object, creating a new buffer. </p>
<p>Modifies the reference for this object, pointing it to a newly-created buffer. Other references to the old object remain unchanges, so this follows copy-on-write semantics. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">b</td><td>A new blob/string to copy. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A reference to this object. </dd></dl>

</div>
</div>
<a class="anchor" id="a929d718638a0646e6f484d07f1610faa"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a>&amp; <a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::operator= </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classmqtt_1_1buffer__ref.html#a792a9ecfb61b558d575240a88b8195a0">blob</a> &amp;&amp;&#160;</td>
          <td class="paramname"><em>b</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Move a string into this object, creating a new buffer. </p>
<p>Modifies the reference for this object, pointing it to a newly-created buffer. Other references to the old object remain unchanges, so this follows copy-on-write semantics. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">b</td><td>A new blob/string to move. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A reference to this object. </dd></dl>

</div>
</div>
<a class="anchor" id="ab9e1fcda1683788fba1eed65006ff375"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a>&amp; <a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::operator= </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>cstr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Copy a NUL-terminated C char array into a new buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cstr</td><td>A NUL-terminated C string. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A reference to this object </dd></dl>

</div>
</div>
<a class="anchor" id="ad9538182730ddbeb04ac35b8cbb95307"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<div class="memtemplate">
template&lt;typename OT &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a>&amp; <a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::operator= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a>&lt; OT &gt; &amp;&#160;</td>
          <td class="paramname"><em>rhs</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Copy another type of buffer reference to this one. </p>
<p>This can copy a buffer of different types, provided that the size of the data elements are the same. This is typically used to convert from char to byte, where the data is the same, but the interpretation is different. Note that this copies the underlying buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">rhs</td><td>A reference to a different type of buffer. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A reference to this object. </dd></dl>

</div>
</div>
<a class="anchor" id="aaab117442ba1e5cf8d870bda1d0096f0"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classmqtt_1_1buffer__ref.html#a1f962b2f5de758efac7e9f45b445d5a0">value_type</a>&amp; <a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::operator[] </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>i</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Gets elemental access to the data buffer (read only) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">i</td><td>The index into the buffer. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The value at the specified index. </dd></dl>

</div>
</div>
<a class="anchor" id="ade1b93fa4991a93f9151dcc758404721"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classmqtt_1_1buffer__ref.html#a9bc5bece985507f5ac0979c9984b5105">pointer_type</a>&amp; <a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::ptr </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Gets a shared pointer to the (const) data buffer. </p>
<dl class="section return"><dt>Returns</dt><dd>A shared pointer to the (const) data buffer. </dd></dl>

</div>
</div>
<a class="anchor" id="a9f0d34a9a04996bbf40274af07ac20d7"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">size_t <a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::size </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Gets the size of the data buffer. </p>
<dl class="section return"><dt>Returns</dt><dd>The size of the data buffer. </dd></dl>

</div>
</div>
<a class="anchor" id="ad43932e2a6a5debe8036d6d5af2d76da"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classmqtt_1_1buffer__ref.html#a792a9ecfb61b558d575240a88b8195a0">blob</a>&amp; <a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::str </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Gets the data buffer as a string. </p>
<dl class="section return"><dt>Returns</dt><dd>The data buffer as a string. </dd></dl>

</div>
</div>
<a class="anchor" id="a940a8cf306fd985b2f3c85a79328b423"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classmqtt_1_1buffer__ref.html#a792a9ecfb61b558d575240a88b8195a0">blob</a>&amp; <a class="el" href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref</a>&lt; T &gt;::to_string </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Gets the data buffer as a string. </p>
<dl class="section return"><dt>Returns</dt><dd>The data buffer as a string. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>src/mqtt/<a class="el" href="buffer__ref_8h_source.html">buffer_ref.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>mqtt</b></li><li class="navelem"><a class="el" href="classmqtt_1_1buffer__ref.html">buffer_ref</a></li>
    <li class="footer">Generated on Sun Jul 23 2017 10:24:29 for Paho C++ by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  </ul>
</div>
</body>
</html>
